package cn.codelab.springcloudalibaba.study.step05.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Seven
 * @description
 * @Gitee https://gitee.com/it-codelab
 * @Copyright 公众号：Seven的代码实验室
 */
@RestController
@RefreshScope // 配合@Value注解实现自动刷新配置
public class TestController {
    @Value("${user.age}")
    private Integer age;

    @RequestMapping("/test")
    public Integer test() {
        return age;
    }
}
